package cn.laixueit.api;

import cn.laixueit.pojo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public interface GoodsApi {
    @GetMapping("/spu/{id}")
    public ResponseEntity<Spu> getSpuById(@PathVariable("id")Long id);


    @GetMapping("/spuDetail/{id}")
    public SpuDetail spuDetail(@PathVariable("id") Long id);

    @GetMapping("/category/findCnameByList")
    public List<Category> findCnameByList(@RequestParam List<Long> cids);

    @GetMapping("/brand/getBrandById/{id}")
    public Brand getBrandById(@PathVariable("id")Long id);

    @GetMapping("/sku/skuListBySpuId/{spuId}")
    public List<Sku> skuListBySpuId(@PathVariable("spuId")Long spuId);

    @GetMapping("/spec/groups/{cid}")
    public List<SpecGroup> groupsByCid(@PathVariable("cid")Long cid);

    @GetMapping("/spec/params")
    public List<SpecParam> specParamsByGid(@RequestParam(value = "gid",required = false)Long gid,
                                    @RequestParam(value = "cid",required = false)Long cid,
                                    @RequestParam(required = false)Boolean searching,
                                    @RequestParam(required = false)Boolean generic);
}
